s = "你好的dhfhsdf"
chinese_chars = set(chr(i) for i in range(0x4e00, 0x9fff))
last_len = 0
len = 0
length = 0
result = ""
for char in s:
    if length >= 5:
        segment = s[last_len: last_len + len]
        result += segment + "\n"
        last_len = last_len + len
        length = 0
        len = 0
    if char in chinese_chars:
        length += 2
        len += 1
    else:
        length += 1
        len += 1
segment = s[last_len:]
result += segment
if result.endswith("\n"):
    result = result[:-1]
print(result)
